
package com.fx.apartment.modules.activity.wrapper;

import com.fx.apartment.modules.activity.entity.ActivityParticipation;
import com.fx.apartment.modules.activity.vo.ActivityParticipationVO;
import com.fx.apartment.common.support.BaseEntityWrapper;
import com.fx.apartment.common.tool.utils.BeanUtil;

import java.util.Objects;

/**
 * 参与活动包装类,返回视图层所需的字段
 *
 * @author QinXueFeng
 * @since 2021-04-19
 */
public class ActivityParticipationWrapper extends BaseEntityWrapper<ActivityParticipation, ActivityParticipationVO> {

	public static ActivityParticipationWrapper build() {
		return new ActivityParticipationWrapper();
 	}

	@Override
	public ActivityParticipationVO entityVO(ActivityParticipation activityParticipation) {
		ActivityParticipationVO activityParticipationVO = Objects.requireNonNull(BeanUtil.copy(activityParticipation, ActivityParticipationVO.class));

		//User createUser = UserCache.getUser(activityParticipation.getCreateUser());
		//User updateUser = UserCache.getUser(activityParticipation.getUpdateUser());
		//activityParticipationVO.setCreateUserName(createUser.getName());
		//activityParticipationVO.setUpdateUserName(updateUser.getName());

		return activityParticipationVO;
	}

}
